package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
	"strconv"
)

func main() {
	apiURL := "http://127.0.0.1:8090"
	u, err := url.ParseRequestURI(apiURL)

	urlParams := url.Values{}
	urlParams.Set("id", strconv.Itoa(100))
	urlParams.Set("name", "username")

	u.RawQuery = urlParams.Encode()

	resp, err := http.Get(u.String())
	if err != nil {
		fmt.Println("get err:", err)
		return
	}
	defer resp.Body.Close()
	r, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println("resp.body failed", err)
	}
	fmt.Println(string(r))
}
